package com.github.wings27.interview.JavaCommonKnowledge;

/**
 * Project Name: common-interview-problems
 * Date Created: 2014/02/17 14:23
 *
 * @author Wings
 */
public class JavaString {
    @SuppressWarnings({"StringEquality", "RedundantStringConstructorCall"})
    public static void main(String[] args) {
        String s1 = "JavaString";
        String s2 = "Java" + "String";
        System.out.println(s1 == s2);  //true
        String s3 = "Java";
        String s4 = "String";
        String s5 = s3 + s4;
        System.out.println(s1 == s5);  //false
        final String s6 = "Java";
        final String s7 = "String";
        String s8 = s6 + s7;
        System.out.println(s1 == s8);  //true
        String s9 = new String("JavaString");
        System.out.println(s9 == s1);  //false
    }
}
